<template>
  <div class="container" style="margin-top: 1%">
    <div class="row">
      <div class="jumbotron" style="background-color: #63ecff">
        <div class="container" >
          <h1>欢迎来到帅气评论区</h1>
        </div>
      </div>
    </div>
    <div class="row">
      <comment-submit @addComment="addComment"/>
      <comment-list :cts="comments"/>
    </div>
  </div>
</template>

<script>
  // 使用父类传递数据，单向传递
import CommentList from "./components/CommentList";
import CommentSubmit from "./components/CommentSubmit";
export default {
  components: {
    CommentList,
    CommentSubmit
  },
  data(){
    return{
      comments:[
        /*{name: '刘德华', content: 'zzp最帅'},
        {name: '张学友', content: 'You are right'},
        {name: '蔡徐坤', content: '鸡你太美'},*/
      ]
    }
  },
  methods:{
    addComment:function (value) {
      this.comments.push(value)
    }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
